﻿using UnityEngine;

namespace Sliver.Roadnet
{
    public class VehicleManager
    {
        public static VehicleManager Instance = new VehicleManager();

        protected static GameObject[] VehicleModels;

        static VehicleManager()
        {
            VehicleModels = Resources.LoadAll<GameObject>("Objects/Vehicles");
        }

        public static GameObject RandomVehicleModel()
        {
            return Object.Instantiate(VehicleModels[(int) (Random.value * VehicleModels.Length)]);
        }
    }
}